//
//  IWAccount.m
//  SINA
//
//  Created by 王相超 on 16/3/31.
//  Copyright © 2016年 chuanzhi. All rights reserved.
//

#import "IWAccount.h"

@implementation IWAccount

-(void)setAccess_token:(NSString *)access_token{
    
    _access_token = access_token;
    self.creatDate = [NSDate date];
}

-(void)encodeWithCoder:(NSCoder *)aCoder{
    
    [aCoder encodeObject:self.access_token forKey:@"access_token"];
    [aCoder encodeObject:self.remind_in forKey:@"remind_in"];
    [aCoder encodeObject:self.uid forKey:@"uid"];
    [aCoder encodeObject:self.creatDate forKey:@"creatDate"];
    [aCoder encodeInteger:self.expires_in forKey:@"expires_in"];
}

-(instancetype)initWithCoder:(NSCoder *)aDecoder{
    
    if (self = [super init]) {
        
        self.access_token = [aDecoder decodeObjectForKey:@"access_token"];
        self.remind_in = [aDecoder decodeObjectForKey:@"remind_in"];
        self.uid = [aDecoder decodeObjectForKey:@"uid"];
        self.expires_in = [aDecoder decodeIntegerForKey:@"expires_in"];
        self.creatDate = [aDecoder decodeObjectForKey:@"creatDate"];
    }
    return self;
}

@end
